<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var isThree = function (n) {
      if (n < 4) return false
      let count = 2

      for (let i = 2; i < n; i++) {
        if ((n % i) === 0) {
          if (count++ > 3) {
            return false
          }
        }
      }
      return count == 3
    };
    console.log(isThree(2));
  </script>
</body>

</html>